# Frame to Wallpaper 

Frame to Wallpaper is a shell script which takes a video and sets a random frame from it as the desktop wallpaper.

## Installation
Make sure you have [feh](https://github.com/derf/feh) and [ffmpeg](https://github.com/FFmpeg/FFmpeg) installed on your machine.  
Then, clone this repository and make sure everything is working properly by executing `ftw.sh`, specifying a video file (you might need to allow execution for this file).
```bash
git clone https://github.com/noxonad/FrameToWallpaper.git
cd FrameToWallpaper
./ftw.sh ~/Videos/myvideo.mp4
```
To install the app, use:
```bash
sudo ./install.sh
```

## Usage
```bash
ftw SOURCE_VIDEO [OPTIONS]
```

Available options are:
```bash
  -h, --help                   Display this text.
  -v                           Enable verbose output. Stacks up to 3 (-vvv).
  -k, --keep-frame             Keep the frame as PNG instead of removing it after usage.
  --frame-location=LOCATION    Frame's file location. Defaults to current folder. 
```

Note: While it is entirely possible to use this script from the terminal, it is highly recommended to set up a cron job or a keybinding for executing this script.

A simple utility you can use is [watch](https://linux.die.net/man/1/watch). You can set the following command when initializing your desktop environment. Note that after the `-n` flag you set the number of seconds the script will be executed again after. In this case, the wallpaper will change every minute.
```bash
watch -n 60 ftw ~/Videos/myvideo.mp4
```

## Update
If you already have this utility installed, you can check its version by running:
```bash
ftw --version
```

If you want to update it, you should run the installation script as follows:
```bash
sudo ./install.sh update
```

Or simply install it and it will detect automatically whether there are any updates.

## Removal
If you decided that you want to remove Frame to wallpaper, you can do it manually by deleting the file from /usr/bin/ftw or by running the following command:
```bash
sudo ./install.sh remove
```

## License
[MIT](https://choosealicense.com/licenses/mit/)
